import-pcolors

 

Import-pcolors is a primitive that allows the user to import an image in NetLogo. As a result,the patch colors are changed and turtles are able to interact with this primitive. The syntax of this primitive is import-pcolors "insert filename here”. The image is scaled to the same dimensions as the patch grid while maintaining the original aspect ratio of the image. The resulting patch colors may be distorted, since the NetLogo color swatches does not include all possible colors. To simply display a backdrop without the color distortion, see import-drawing. The following image file formats are supported: JPG, GIF, and PNG. Note: This primitive is not compatible with NetLogo Web.

 

Try it Yourself

 
 
 
 
 
 
 

What's next?

Once you mastered the import-pcolors primitive, don't stop there. Check out the resources below to improve your NetLogo skills.

 
Similar primitives:
pcolor

built-in patch variable that holds the color of the patch

Read more
patches

Address all patches of a model.

Read more
patches-own

Declare a variable that belongs to patches.

Read more
set

Set the value of a variable.

Read more
 
Learn another primitive